<html>
<body>
<script type="text/javascript" charset="utf-8">
  function preventNextBeforeUnload() {
    window.addEventListener('beforeunload', function handler(e) {
      e.preventDefault();
      e.returnValue = '';
      window.removeEventListener('beforeunload', handler)
      setTimeout(function() {
        require('electron').ipcRenderer.sendSync('onbeforeunload')
      }, 0);
      return false;
    })
  }
</script>
</body>
</html>
